package com.test.javafaq_faq.controller;



import com.test.javafaq_commons.entity.Tag;
import com.test.javafaq_commons.vo.R;
import com.test.javafaq_faq.service.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author test.com
 * @since 2025-04-11
 */
@RestController
@RequestMapping("/v1/tags")
public class TagController {

    @Autowired
    ITagService tagService;

    //返回所有tag标签的服务
    @GetMapping("/list")
    public List<Tag> list(){
        return tagService.getTags();
    }

    @GetMapping("")
    public R<List<Tag>> tags(){
        List<Tag> list = tagService.getTags();
        return R.ok(list);
    }

}
